package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * MessageRelatedPerson generated by hbm2java
 */
@Entity
@Table(name = "message_related_person")
public class MessageRelatedPerson implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfo;
	private TrainNoticePart trainNoticePart;
	private Long college;
	private Long groups;
	private int identity;
	private int state;
	private int selectStatus;
	private int trainStatus;
	private Long recallMessage;
	private String remark;
	private long backId;
	private Set<MessageRelatedPerson> messageRelatedPersonsForSelectedId = new HashSet<MessageRelatedPerson>(
			0);
	private Set<MessageRelatedPerson> messageRelatedPersonsForSelectId = new HashSet<MessageRelatedPerson>(
			0);

	public MessageRelatedPerson() {
	}

	public MessageRelatedPerson(int identity, int state, int selectStatus,
			int trainStatus, long backId) {
		this.identity = identity;
		this.state = state;
		this.selectStatus = selectStatus;
		this.trainStatus = trainStatus;
		this.backId = backId;
	}

	public MessageRelatedPerson(UserBaseInfo userBaseInfo,
			TrainNoticePart trainNoticePart, Long college, Long groups,
			int identity, int state, int selectStatus, int trainStatus,
			Long recallMessage, String remark, long backId,
			Set<MessageRelatedPerson> messageRelatedPersonsForSelectedId,
			Set<MessageRelatedPerson> messageRelatedPersonsForSelectId) {
		this.userBaseInfo = userBaseInfo;
		this.trainNoticePart = trainNoticePart;
		this.college = college;
		this.groups = groups;
		this.identity = identity;
		this.state = state;
		this.selectStatus = selectStatus;
		this.trainStatus = trainStatus;
		this.recallMessage = recallMessage;
		this.remark = remark;
		this.backId = backId;
		this.messageRelatedPersonsForSelectedId = messageRelatedPersonsForSelectedId;
		this.messageRelatedPersonsForSelectId = messageRelatedPersonsForSelectId;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_BASE_INFO")
	public UserBaseInfo getUserBaseInfo() {
		return this.userBaseInfo;
	}

	public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
		this.userBaseInfo = userBaseInfo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TRAIN_ID")
	public TrainNoticePart getTrainNoticePart() {
		return this.trainNoticePart;
	}

	public void setTrainNoticePart(TrainNoticePart trainNoticePart) {
		this.trainNoticePart = trainNoticePart;
	}

	@Column(name = "COLLEGE")
	public Long getCollege() {
		return this.college;
	}

	public void setCollege(Long college) {
		this.college = college;
	}

	@Column(name = "GROUPS")
	public Long getGroups() {
		return this.groups;
	}

	public void setGroups(Long groups) {
		this.groups = groups;
	}

	@Column(name = "IDENTITY", nullable = false)
	public int getIdentity() {
		return this.identity;
	}

	public void setIdentity(int identity) {
		this.identity = identity;
	}

	@Column(name = "STATE", nullable = false)
	public int getState() {
		return this.state;
	}

	public void setState(int state) {
		this.state = state;
	}

	@Column(name = "SELECT_STATUS", nullable = false)
	public int getSelectStatus() {
		return this.selectStatus;
	}

	public void setSelectStatus(int selectStatus) {
		this.selectStatus = selectStatus;
	}

	@Column(name = "TRAIN_STATUS", nullable = false)
	public int getTrainStatus() {
		return this.trainStatus;
	}

	public void setTrainStatus(int trainStatus) {
		this.trainStatus = trainStatus;
	}

	@Column(name = "RECALL_MESSAGE")
	public Long getRecallMessage() {
		return this.recallMessage;
	}

	public void setRecallMessage(Long recallMessage) {
		this.recallMessage = recallMessage;
	}

	@Column(name = "REMARK", length = 200)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "BACK_ID", nullable = false)
	public long getBackId() {
		return this.backId;
	}

	public void setBackId(long backId) {
		this.backId = backId;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "select_person", joinColumns = { @JoinColumn(name = "SELECT_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "SELECTED_ID", nullable = false, updatable = false) })
	public Set<MessageRelatedPerson> getMessageRelatedPersonsForSelectedId() {
		return this.messageRelatedPersonsForSelectedId;
	}

	public void setMessageRelatedPersonsForSelectedId(
			Set<MessageRelatedPerson> messageRelatedPersonsForSelectedId) {
		this.messageRelatedPersonsForSelectedId = messageRelatedPersonsForSelectedId;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "select_person", joinColumns = { @JoinColumn(name = "SELECTED_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "SELECT_ID", nullable = false, updatable = false) })
	public Set<MessageRelatedPerson> getMessageRelatedPersonsForSelectId() {
		return this.messageRelatedPersonsForSelectId;
	}

	public void setMessageRelatedPersonsForSelectId(
			Set<MessageRelatedPerson> messageRelatedPersonsForSelectId) {
		this.messageRelatedPersonsForSelectId = messageRelatedPersonsForSelectId;
	}

}
